package day0217.extend;

/**
 * 不推荐，不允许滥用继承
 *  pig is a person 错误的
 */
public class Pig extends Person {

    public static void main(String[] args) {
        Pig pig = new Pig();

        pig.name = "佩奇";
        pig.age = 6;
        pig.gender = "公";


    }
}

/**
 * 除了 is a 关系以外还有一种关系 has a
 */
class Computer {
    Cpu cpu;

    Ram ram;

    public static void main(String[] args) {
        Computer computer = new Computer();
        computer.cpu = new Cpu();

        computer.cpu.name = "i9-12000";
        computer.cpu.type = "intel";

    }
}
class Cpu {
    String type;

    String name;

}
class Ram {

    int size;

    int level;
}

